{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "52a2ec2e",
   "metadata": {},
   "source": [
    "## 1. 交互式命令"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c540fa94",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['__doc__',\n",
       " '__loader__',\n",
       " '__name__',\n",
       " '__package__',\n",
       " '__spec__',\n",
       " 'acos',\n",
       " 'acosh',\n",
       " 'asin',\n",
       " 'asinh',\n",
       " 'atan',\n",
       " 'atan2',\n",
       " 'atanh',\n",
       " 'cbrt',\n",
       " 'ceil',\n",
       " 'comb',\n",
       " 'copysign',\n",
       " 'cos',\n",
       " 'cosh',\n",
       " 'degrees',\n",
       " 'dist',\n",
       " 'e',\n",
       " 'erf',\n",
       " 'erfc',\n",
       " 'exp',\n",
       " 'exp2',\n",
       " 'expm1',\n",
       " 'fabs',\n",
       " 'factorial',\n",
       " 'floor',\n",
       " 'fmod',\n",
       " 'frexp',\n",
       " 'fsum',\n",
       " 'gamma',\n",
       " 'gcd',\n",
       " 'hypot',\n",
       " 'inf',\n",
       " 'isclose',\n",
       " 'isfinite',\n",
       " 'isinf',\n",
       " 'isnan',\n",
       " 'isqrt',\n",
       " 'lcm',\n",
       " 'ldexp',\n",
       " 'lgamma',\n",
       " 'log',\n",
       " 'log10',\n",
       " 'log1p',\n",
       " 'log2',\n",
       " 'modf',\n",
       " 'nan',\n",
       " 'nextafter',\n",
       " 'perm',\n",
       " 'pi',\n",
       " 'pow',\n",
       " 'prod',\n",
       " 'radians',\n",
       " 'remainder',\n",
       " 'sin',\n",
       " 'sinh',\n",
       " 'sqrt',\n",
       " 'sumprod',\n",
       " 'tan',\n",
       " 'tanh',\n",
       " 'tau',\n",
       " 'trunc',\n",
       " 'ulp']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import math\n",
    "dir(math)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5e0ecfb0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "module"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(math)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7728fe96",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The \"yield\" statement\n",
      "*********************\n",
      "\n",
      "   yield_stmt ::= yield_expression\n",
      "\n",
      "A \"yield\" statement is semantically equivalent to a yield expression.\n",
      "The \"yield\" statement can be used to omit the parentheses that would\n",
      "otherwise be required in the equivalent yield expression statement.\n",
      "For example, the yield statements\n",
      "\n",
      "   yield <expr>\n",
      "   yield from <expr>\n",
      "\n",
      "are equivalent to the yield expression statements\n",
      "\n",
      "   (yield <expr>)\n",
      "   (yield from <expr>)\n",
      "\n",
      "Yield expressions and statements are only used when defining a\n",
      "*generator* function, and are only used in the body of the generator\n",
      "function.  Using \"yield\" in a function definition is sufficient to\n",
      "cause that definition to create a generator function instead of a\n",
      "normal function.\n",
      "\n",
      "For full details of \"yield\" semantics, refer to the Yield expressions\n",
      "section.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help('yield')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "59f9a293",
   "metadata": {},
   "source": [
    "## 2. 读文档"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6ed1524",
   "metadata": {},
   "source": [
    "Language reference是官方语法参考\n",
    "Library Reference内置函数和标准库"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c64e2c86",
   "metadata": {},
   "source": [
    "## 3. python命令"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "53312a9c",
   "metadata": {},
   "source": [
    "python -m pydoc module.Class.method"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1d119813",
   "metadata": {},
   "source": [
    "## 4. 使用模块,inspect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f0d829cf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "OrderedDict({'args': <Parameter \"*args\">, 'sep': <Parameter \"sep=' '\">, 'end': <Parameter \"end='\\n'\">, 'file': <Parameter \"file=None\">, 'flush': <Parameter \"flush=False\">})\n"
     ]
    }
   ],
   "source": [
    "import inspect\n",
    "\n",
    "def get_function_params(func):\n",
    "    params = inspect.signature(func).parameters\n",
    "    return params\n",
    "print(get_function_params(print))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bbc7b8fe",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "mining",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
